import request from '@/utils/request';

/**
 * 获取关工组织列表
 * @param {*} params
 */
export async function getCaresList(params) {
  return request('/legalDistrict/page', {
    method: 'GET',
    params,
  });
}

/**
 * 获取管理信息公开列表
 * @param {*} params
 */
export async function getInfoOpenList(params) {
  return request('/informationDisclosure/admin/page', {
    method: 'GET',
    params,
  });
}

/**
 * 获取管理信息公开列表
 * @param {*} params
 */
export async function getPubList(params) {
  return request('/informationDisclosure/admin/publisherList', {
    method: 'GET',
    params,
  });
}

/**
 * 获取信息公开详情
 * @param {*} params
 */
export async function getInfoOpenDetail(params) {
  return request(`/informationDisclosure/${params.id}`, {
    method: 'GET',
    params,
  });
}
/**
 * 新增信息公开
 * @param {*} params
 */
export async function addInfoOpen(params) {
  return request(`/informationDisclosure/admin/add`, {
    method: 'POST',
    data: params,
  });
}
/**
 * 编辑信息公开
 * @param {*} params
 */
export async function updateInfoOpen(params) {
  return request(`/informationDisclosure/admin/update`, {
    method: 'PUT',
    data: params,
  });
}
/**
 * 新增法务区简介
 * @param {*} params
 */
export async function addArrairOpen(params) {
  return request(`/legalDistrict/add`, {
    method: 'POST',
    data: params,
  });
}

/**
 * 获取法务区详情
 * @param {*} params
 */
export async function getArrairOpenDetail(params) {
  return request(`/legalDistrict/${params.id}`, {
    method: 'GET',
    params,
  });
}
/**
 * 编辑法务区简介
 * @param {*} params
 */
export async function updateArrairOpen(params) {
  return request(`/legalDistrict/update`, {
    method: 'PUT',
    data: params,
  });
}
/**
 * 置顶信息公开
 * @param {*} params
 */
export async function infoIsTop(params) {
  return request(`/informationDisclosure/admin/top`, {
    method: 'PUT',
    data: params,
  });
}
/**
 * 首页显示
 * @param {*} params
 */
export async function isHomepage(params) {
  return request(`/informationDisclosure/admin/homepage`, {
    method: 'PUT',
    data: params,
  });
}

// * 停用启用
// * @param {*} params
// *
export async function isStatus(params) {
  return request(`/legalDistrict/enable`, {
    method: 'PUT',
    data: params,
  });
}
/**
 * 简介显示
 * @param {*} params
 */
export async function isLegalDistrict(params) {
  return request(`/informationDisclosure/admin/legal`, {
    method: 'PUT',
    data: params,
  });
}

/**
 * 获取关工组织详情
 * @param {*} params
 */
export async function caresDetail(params) {
  return request(`/care-generation/mechanism/${params.id}`, {
    method: 'GET',
    params,
  });
}

/**
 * 删除信息公开
 * @param {*} params
 */
export async function deleteInfoOpen(params) {
  return request(`/informationDisclosure/admin/delete/${params.id}`, {
    method: 'DELETE',
    data: params,
  });
}

/**
 * 删除法务区简介
 * @param {*} params
 */
export async function deleteCares(params) {
  return request(`/legalDistrict/delete/${params.id}`, {
    method: 'DELETE',
    data: params,
  });
}

/**
 * 获取关工动态详情
 * @param {*} params
 */
export async function trendsDetail(params) {
  return request(`/care-generation/${params.id}`, {
    method: 'GET',
    params,
  });
}

/**
 * 获取法务简介动态详情
 * @param {*} params
 */
export async function trendsAffairDetail(params) {
  return request(`/legalDistrict/preview${params.id}`, {
    method: 'GET',
    params,
  });
}
/**
 * 编辑关工组织
 * @param {*} params
 */
export async function updateCares(params) {
  return request(`/care-generation/mechanism/${params.id}`, {
    method: 'PUT',
    data: params,
  });
}
/**
 * 新增关工动态
 * @param {*} params
 */
export async function addTrends(params) {
  return request(`/care-generation`, {
    method: 'POST',
    data: params,
  });
}
/**
 * 新增成员
 * @param {*} params
 */
export async function addMember(params) {
  return request(`/care-generation/member`, {
    method: 'POST',
    data: params,
  });
}

/**
 * 编辑成员信息
 * @param {*} params
 */
export async function updateMember(params) {
  return request(`/care-generation/member/${params.id}`, {
    method: 'PUT',
    data: params,
  });
}
/**
 * 删除成员信息
 * @param {*} params
 */
export async function deleteMember(params) {
  return request(`/care-generation/member`, {
    method: 'DELETE',
    data: params,
  });
}
